package edu.cque.jt.consumer.controller;

import edu.cque.jt.consumer.service.RemoteProviderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Hua
 * @create 2022-07-19 18:33
 */
@RestController
@RequestMapping("/consumer")
public class FeignConsumerController {
    @Autowired
    private RemoteProviderService remoteProviderService;

    //基于feign方式的远程服务调用
    @GetMapping("/echo/{msg}")
    public String doFeignEcho(@PathVariable String msg){

        return remoteProviderService.echoMsg(msg);
    }
}
